package net.wangliping.android.tools;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;

public class ToolUtils {

	public final static String TAG = "AndTools";

	private static Drawable mDallpaperDrawable = null;

	private static List<ActivityInfo> mActivityList = null;

	public static void setBackground(Context context, View view) {
		if (mDallpaperDrawable == null)
			mDallpaperDrawable = context.getWallpaper();

		view.setBackgroundDrawable(mDallpaperDrawable);
	}

	public static void addActivityToMain(String cls, String name, int icon) {
		if (mActivityList == null)
			mActivityList = new ArrayList<ActivityInfo>();

		ActivityInfo info = new ActivityInfo(cls, name, icon);
		mActivityList.add(info);
	}

	public static List<ActivityInfo> getActvityList() {
		return mActivityList;
	}

	public static class ActivityInfo {
		public final String className;
		public final String appName;
		public final int appIcon;

		public ActivityInfo(String cls, String name, int icon) {
			className = cls;
			appName = name;
			appIcon = icon;
		}
	}
}
